package com.lzc.syn;

/**
 * 递归调用本方法
 *
 * @author lizhichuan
 * @date 2024/7/11 10:48
 */
public class SynchronizedRecursion10 {

    int a = 0;

    public static void main(String[] args) {
         SynchronizedRecursion10 s = new SynchronizedRecursion10();
         s.method1();
    }

    public synchronized void method1(){
        System.out.println("这是method1，a= " + a);
        if(a == 0){
           a++;
           method1();
        }
    }


}
